﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:p="clr-namespace:Lithnet.Acma.Presentation"
                    xmlns:a="clr-namespace:Lithnet.Acma;assembly=Lithnet.Acma"
                    xmlns:fim="clr-namespace:Microsoft.MetadirectoryServices;assembly=Microsoft.MetadirectoryServicesEx"
                    xmlns:core="clr-namespace:Lithnet.Common.Presentation;assembly=Lithnet.Common.Presentation">

    <DataTemplate  DataType="{x:Type p:AcmaSchemaMappingViewModel}">
        <StackPanel>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto"/>
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>

                <Label Content="Object class"
                       Grid.Row="0"
                       Grid.Column="0" />
                <TextBox Text="{Binding ObjectClassName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true, Mode=OneWay}"
                         Grid.Row="0"
                         Grid.Column="1" 
                         IsReadOnly="True"/>

                <Label Content="Attribute"
                       Grid.Row="1"
                       Grid.Column="0" />
                <TextBox Text="{Binding AttributeName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true, Mode=OneWay}"
                         Grid.Row="1"
                         Grid.Column="1" 
                         IsReadOnly="True"/>

                <Label Content="Inheritance source attribute"
                       Grid.Row="2"
                       Grid.Column="0"
                       Visibility="{Binding IsInherited, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
                <TextBox Text="{Binding InheritanceSourceName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true, Mode=OneWay}"
                         Grid.Row="2"
                         Grid.Column="1"
                         IsReadOnly="True"
                         Visibility="{Binding IsInherited, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />

                <Label Content="Inherited attribute"
                       Grid.Row="3"
                       Grid.Column="0"
                       Visibility="{Binding IsInherited, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
                <TextBox Text="{Binding InheritedAttributeName, ValidatesOnDataErrors=True, ValidatesOnExceptions=true, Mode=OneWay}"
                         Grid.Row="3"
                         Grid.Column="1"
                         IsReadOnly="True"
                         Visibility="{Binding IsInherited, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
                

                <Label Content="This is a built-in mapping and cannot be deleted"
                       Grid.Row="4"
                       Grid.ColumnSpan="2"
                       Visibility="{Binding IsBuiltIn, Converter={StaticResource BooleanToVisibilityConverter}, Mode=OneWay}" />
                
            </Grid>
        </StackPanel>
    </DataTemplate>
    
</ResourceDictionary>